<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">  
   <h:form>
    
     <p:panel id="infosPanel" toggleable="true" styleClass="panelForm" 
              header="#{msg['ajouter.candidat.form.title']}">
	          <!-- 
	          <p:messages autoUpdate="true" closable="true" id="msgs" showDetail="true" showSummary="false" />
	           -->
	           
		      <p:panelGrid id="infosGrid" columns="2" styleClass="centered" columnClasses="column1,column2">
              
                  <h:outputText  value="#{msg['candidat.nom']}" />
                  <h:column>
		            <p:inputText  id="nom" required="true" label="Nom"
		                          value="#{candidatController.candidat.nom}"></p:inputText>
		            <span style="padding: 0px;margin: 0px;color: red;font-size: 10">* </span> 
                  </h:column>
		          
		          <h:outputText  value="#{msg['candidat.prenom']}" />
		          <h:column>
		            <p:inputText id="prenom" required="true" label="prenom"
		                         value="#{candidatController.candidat.prenom}"></p:inputText>
		             <span style="padding: 0px;margin: 0px;color: red;font-size: 10">*</span>
		          </h:column>
		          
		         <h:outputText  value="#{msg['candidat.cin']}" />
		          <h:column>
		            <p:inputText id="cin" required="true" label="cin"
		                         value="#{candidatController.candidat.cin}"></p:inputText>
		             <span style="padding: 0px;margin: 0px;color: red;font-size: 10">*</span>
		          </h:column>
		          
		         <h:outputText  value="#{msg['candidat.phone']}" />
		         <h:column>
		           <p:inputText id="phone" required="true" label="#{msg['candidat.phone']}" value="#{candidatController.candidat.numTele}"></p:inputText>
		           <span style="padding: 0px;margin: 0px;color: red;font-size: 10">*</span>
		         </h:column>
		          
		         <h:outputText  value="#{msg['candidat.date.naissance']}" />
		         <h:column>
		            <p:calendar  required="false" label="#{msg['candidat.date.naissance']}"
		                         id="dateNaissance" showOn="button" navigator="true" 
		                         pattern="dd/MM/yyyy"  
		                         showButtonPanel="true" readonlyInput="true"  
		                         effect="slide" effectDuration="fast"
		                         value="#{candidatController.candidat.dateNaissance}"></p:calendar>
		         </h:column>

		         <h:outputText  value="#{msg['candidat.email']}" />
		         <p:inputText id="email" size="30" required="false" label="#{msg['candidat.email']}" value="#{candidatController.candidat.email}"></p:inputText>
		          
		          
		         <h:outputText title="Adresse !"  value="#{msg['candidat.adresse']}" />
		         <p:inputTextarea rows="5" cols="70" label="#{msg['candidat.adresse']}" id="adresse"  value="#{candidatController.candidat.adresse}" ></p:inputTextarea>
   
		      </p:panelGrid>
      <p:separator></p:separator>
	    <p:commandButton value="Save" id="saveBtn" icon="ui-icon-check" 
		                       process="@form" 
		                       action="#{candidatController.ajouterCandidat}" update="infosGrid" />
         <p:commandButton value="Initialiser" 
                        id="resetBtn" icon="ui-icon-refresh" 
                        action="#{candidatController.initCandidatForm}" 
                        process="@this"
                        update="infosGrid" />
          
	</p:panel>
	
	<p:blockUI block="infosPanel" trigger="saveBtn, resetBtn">  
        Loading...<br />  
        <p:graphicImage value="#{msg['images.loading.path']}"/>  
    </p:blockUI>
   </h:form>
</html>
